#ifndef HASIO_DETAIL_IO_OBJECT_IMPL_HPP
#define HASIO_DETAIL_IO_OBJECT_IMPL_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200

namespace hasio {
namespace detail {

template <typename IOObjectService>
class io_object_impl
{
public:
    using service_type = IOObjectService;
    using implementation_type = typename service_type::implementation_type;

    explicit io_object_impl(const io_context &context)
        //: service_(new service_type(context))
        : service_(nullptr)
    {
    }

    io_object_impl(io_object_impl&&) = default;

    ~io_object_impl()
    {
        delete service_;
    }

    service_type& get_service()
    {
        return *service_;
    }

private:
    service_type* service_;
};

}
}

#endif // HASIO_DETAIL_IO_OBJECT_IMPL_HPP 